{% extends 'Base/main.content.lists.div.html.twig' %}
{% import 'Base/list_item.twig' as listItem %}

{% block options %}
    <div class="menu-list">
        {#{{ dump(tools) }}#}
        {% for key , classes in tools %}
            {% set default = "请选择分类" %}
            {% set classes = classes %}
            <div class="rule-single-select">
                <select name="cond[{{ key }}]" onchange="javascript:__doPostBack('searchCond','')" >
                    <option value="" {{app.request.get("cond")[key] is defined and app.request.get("cond")[key] == "" ? ' selected="selected"' : "" }} >{{ default }}</option>
                    {% for class in classes %}
                        <option value="{{ class.id }}"
                                {{app.request.get("cond")[key] is defined and  app.request.get("cond")[key] == class.id ? ' selected="selected"' : "" }}
                        >{{ class.name }}</option>
                    {% endfor %}
                </select>
            </div>
        {% endfor %}
    </div>
{% endblock %}
{% block tableHead %}
    <tr>
        <th align="" width="">选择</th>
        <th align="" width="">图片</th>
        <th align="" width="">标题</th>
        <th align="" width="">年级</th>
        <th align="" width="">科目</th>
        <th align="" width="">讲师</th>
        <th align="" width="">课时</th>
        <th align="" width="">时长</th>
        <th align="" width="">创建时间</th>
        <th align="" width="">更新时间</th>
        <th align="" width="">是否置顶</th>
        <th align="" width="">是否热门</th>
        <th align="" width="">是否开放</th>
        <th align="" width="">操作</th>
    </tr>
{% endblock %}
{% block tableList %}
    {% for Entity in lists %}
        <tr>
            <td align='' width=''>
                <span class="checkall"><input lay-skin="primary" type="checkbox" name="ids[]" value="{{ Entity.Topic_id }}"/></span>
            </td>
            <td align='' width='' id='pic_{{ Entity.Topic_id }}'>
                {{ listItem.pic('pic',Entity.Topic_pic,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='title_{{ Entity.Topic_id }}'>
                {{ listItem.text('title',Entity.Topic_title,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='grade_Id_{{ Entity.Topic_id }}'>
                {{ listItem.text('grade_Id',Entity.Grade_name,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='subject_Id_{{ Entity.Topic_id }}'>
                {{ listItem.text('subject_Id',Entity.Subject_name,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='teacher_Id_{{ Entity.Topic_id }}'>
                {{ listItem.text('teacher_Id',Entity.Teacher_name,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='video_Num_{{ Entity.Topic_id }}'>
                {{ listItem.text('video_Num',Entity.Topic_video_Num,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='video_Time_{{ Entity.Topic_id }}'>
                {{ listItem.text('video_Time',Entity.Topic_video_Time,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='addtime_{{ Entity.Topic_id }}'>
                {{ listItem.day('addtime',Entity.Topic_addtime,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='updatetime_{{ Entity.Topic_id }}'>
                {{ listItem.day('updatetime',Entity.Topic_updatetime,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='is_Top_{{ Entity.Topic_id }}'>
                {{ listItem.switch('isTop',Entity.Topic_is_Top,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='is_Hot_{{ Entity.Topic_id }}'>
                {{ listItem.switch('isHot',Entity.Topic_is_Hot,Entity.Topic_id) }}
            </td>
            <td align='' width='' id='is_On_{{ Entity.Topic_id }}'>
                {{ listItem.switch('isOn',Entity.Topic_is_On,Entity.Topic_id) }}
            </td>
            <td align='' width=''>
                {#{{ listItem.edit('Topic','',Entity.Topic_id) }}#}
                <div class="layui-btn-group">
                    <a href="{{ path("TopicVideoLists",{'id':Entity.Topic_id}) }}"
                       class="layui-btn layui-btn-normal layui-btn-sm">课程管理</a>
                    <a href="{{ path("TopicPreEdit",{'id':Entity.Topic_id}) }}"
                       class="layui-btn layui-btn-normal layui-btn-sm">编辑信息</a>
                </div>
            </td>
        </tr>
    {% endfor %}
{% endblock %}
{% block script %}
{% endblock %}

